home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Net / Utilities / Seer family 2.0 / docs / unloved files / qpacket_format.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-08-29  |  1.8 KB  |  56 lines  |  [TEXT/KAHL]

  1. /* sdpakhdr.h - define all know data packets
  2.    srpakhdr.h defines the hardware flags the rest of the
  3.    packets are defined here.
  4.  
  5.  
  6.    since a alap is odd length, it needs to expanded each time used
  7.    Note that the ALAP fields and ddp fields (both short and long ddp)
  8.    add up to an evan number of bytes. Therefore the ddp records
  9.    can be included in other records and will align properly.
  10. */
  11. #define ALAP_fields \
  12.     uint8 al_dest;        /* who the packet is addressed to */ \
  13.     uint8 al_src;        /* where the packet is from */ \
  14.     uint8 al_type;        /* what kind of data follows */
  15.  
  16. /* macro to load a ddp length field */
  17. #define ddplen(xxxx) ((xxxx.hlen <<8) + xxxx.llen)
  18.  
  19. /* define a DDP short header */
  20. struct DDP_short_R {
  21.   ALAP_fields                /* alap, dst,src, type */
  22.   uint8  zro:6,             /* reserved, must be zero */
  23.          hlen:2;            /* high bits of ddp length */
  24.   uint8    llen;                /* low bits of ddp length */
  25.   uint8 dst_sok;            /* DDP destination socket */
  26.   uint8 src_sok;            /* DDP source socket */
  27.   uint8 ty;                    /* DDP proticol type */
  28. };
  29. typedef struct DDP_short_R DDP_short;
  30.  
  31. /* define a DDP long header */
  32. struct DDP_long_R {
  33.   ALAP_fields                 /* alap, dst,src, type */
  34.   uint8  zro:2,                /* reserved, must be zero */
  35.            hop:4,                /* hop count */
  36.          hlen:2;            /* high bits of ddp length */
  37.   uint8    llen;                /* low bits of ddp length */
  38.   uint16 cks;                /* network checksum */
  39.   uint16 dst_net;            /* destination network */
  40.   uint16 src_net;            /* source network */
  41.   uint8 dst_nod;            /* destination node id */
  42.   uint8 src_nod;            /* source node id */
  43.   uint8 dst_sok;            /* DDP destination socket */
  44.   uint8 src_sok;            /* DDP source socket */
  45.   uint8 ty;                    /* DDP proticol type */
  46. };
  47. typedef struct DDP_long_R DDP_long;
  48.  
  49. struct sdpakhdr_R {
  50.   union {
  51.       DDP_short sddp;
  52.       DDP_long  lddp;
  53.       } xddp;
  54. };
  55. typedef struct sdpakhdr_R sdpakhdr;
  56.